package main

import (
	"fmt"
	"log"
	"os"
)

type Name struct {
	dd string
}

/**
初始化日志文件
*/
func init() {
	fmt.Println("main init")
	file := "./" + "bms.log"
	logFile, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0766)
	if err != nil {
		panic(err)
	}
	log.SetOutput(logFile) // 将文件设置为log输出的文件
	log.SetFlags(log.LstdFlags | log.Lshortfile | log.LUTC)
}

//执行命令
// 1. cd ./src/main  2. D:\goRepository\src\github.com\mitchellh\gox\gox.exe
// 3. D:\goRepository\src\github.com\mitchellh\gox\gox.exe -os "linux" 只编译linux版本
// 4.D:\goRepository\src\github.com\mitchellh\gox\gox.exe -osarch="linux/arm" 只编译arm版本
// 程序的入口
func main() {

	fmt.Print("hello wrold")
	//http.Handle("/pages/", http.StripPrefix("/pages/", http.FileServer(http.Dir("static/pages"))))
	//http.Handle("/js/", http.StripPrefix("/js/", http.FileServer(http.Dir("static/js"))))
	//web.Router()
	//http.ListenAndServe(":8080", nil)
	//
	//resultJson := util.ResultJson{Code: 2, Value: "222", Msg: "3333"}
	//b, err := json.Marshal(resultJson)
	//if err != nil {
	//	fmt.Println("Umarshal failed:", err)
	//}

}
